function CartAssistant(argFromPusher) {
}

CartAssistant.prototype = {
	setup: function() {
		Ares.setupSceneAssistant(this);
		this.$.totalLbl.setShowing(showPrice(user));
	},
	cleanup: function() {
		Ares.cleanupSceneAssistant(this);
	},
	activate: function() {
		this.m_cartList.items = getCartList();
		if(showPrice(user)) {
			this.m_cartList.items.each(function(item){
				item.priceStr = parseFloat(item.price).toFixed(2);
			});
		}
		this.controller.modelChanged(this.m_cartList);
		this.printTotal();
	},
	list1Listdelete: function(inSender, event) {
		removeFromCart(event.item);
		this.m_cartList.items = getCartList();
		//this.controller.modelChanged(this.m_cartList);
		this.printTotal();
	},
	printTotal: function(){
		var total = 0;
		this.m_cartList.items.each(function(p){
			total += parseFloat(p.price);
		});
		this.m_total.label = "Total: $" + total.toFixed(2);
		this.controller.modelChanged(this.m_total);
	},
	submitTap: function(inSender, event) {
		if(this.m_cartList.items.length == 0){
			myAlert(this, "No item is in the cart.");
			return;
		}
		Mojo.Controller.stageController.pushScene("createOrder"); 
	}
};